﻿<Window x:Class="Vtron.ATSP.WpfApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Vtron.ATSP.WpfApp.Controls"
        Title="屏幕测试仪连接配置" Height="480" Width="640">
    <Window.Resources>
        <Style x:Key="TextBlockStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="Margin" Value="0,0,5,0"/>
            <Setter Property="FontSize" Value="13.333"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="Width" Value="350"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="5,3,0,3"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="Background" Value="{x:Null}"/>
        </Style>
        <Style TargetType="Border">
            <Setter Property="BorderBrush" Value="LightGray"/>
            <Setter Property="BorderThickness" Value="1"/>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid x:Name="connect_grid" Visibility="Collapsed">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Text="标准投影机连接" Margin="20,10,0,10" FontSize="18"/>
            <Line Grid.Row="1" Stretch="Fill" X2="1" Stroke="#cccccc" />
            <Grid Grid.Row="2" Margin="0,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0" Text="投影机机IP：" Style="{StaticResource TextBlockStyle}"/>
                <Controls:IPAddressControl x:Name="projectorIp_TextBox" Width="250" Grid.Row="0" Grid.Column="1"/>
                <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Horizontal" Margin="5,20" HorizontalAlignment="Center">
                    <Button  x:Name="startProjector_btn" Content="开机" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="startProjector_btn_Click"/>
                    <Button  x:Name="closeProjector_btn" Content="关机" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Margin="120,0,0,0" Click="closeProjector_btn_Click"/>
                </StackPanel>
            </Grid>
            <Line Grid.Row="3" Stretch="Fill" X2="1" Stroke="#cccccc" />
            <TextBlock Grid.Row="4" Text="亮度传感器连接" Margin="20,10,0,10" FontSize="18"/>
            <Line Grid.Row="5" Stretch="Fill" X2="1" Stroke="#cccccc" />
            <Grid Grid.Row="6" Margin="0,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0" Text="主机串口设置：" Style="{StaticResource TextBlockStyle}"/>
                <ComboBox x:Name="testerPortName_ComboBox" Grid.Row="0" Grid.Column="1" MaxWidth="100" HorizontalAlignment="Left"  Margin="5,20">
                    <ComboBoxItem IsSelected="True">COM1</ComboBoxItem>
                    <ComboBoxItem>COM2</ComboBoxItem>
                    <ComboBoxItem>COM3</ComboBoxItem>
                    <ComboBoxItem>COM4</ComboBoxItem>
                    <ComboBoxItem>COM5</ComboBoxItem>
                    <ComboBoxItem>COM6</ComboBoxItem>
                    <ComboBoxItem>COM7</ComboBoxItem>
                    <ComboBoxItem>COM8</ComboBoxItem>
                    <ComboBoxItem>COM9</ComboBoxItem>
                    <ComboBoxItem>COM10</ComboBoxItem>
                </ComboBox>
                <TextBlock Grid.Row="0" Grid.Column="2" Text="波特率设置：" Style="{StaticResource TextBlockStyle}"/>
                <ComboBox x:Name="testerBaudRate_ComboBox" Grid.Row="0" Grid.Column="3" MaxWidth="100" HorizontalAlignment="Left" Margin="5,20">
                    <ComboBoxItem>300</ComboBoxItem>
                    <ComboBoxItem>600</ComboBoxItem>
                    <ComboBoxItem>1200</ComboBoxItem>
                    <ComboBoxItem>2400</ComboBoxItem>
                    <ComboBoxItem>4800</ComboBoxItem>
                    <ComboBoxItem IsSelected="True">9600</ComboBoxItem>
                    <ComboBoxItem>19200</ComboBoxItem>
                    <ComboBoxItem>38400</ComboBoxItem>
                    <ComboBoxItem>57600</ComboBoxItem>
                    <ComboBoxItem>115200</ComboBoxItem>
                </ComboBox>
                <Button Grid.Row="1" Grid.ColumnSpan="4" Content="连接" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Margin="0,20" x:Name="testerConnect_btn" Click="testerConnect_btn_Click"/>
            </Grid>
        </Grid>

        <Grid x:Name="functionChoise_grid" Visibility="Collapsed">
            <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Horizontal" Margin="5,20" HorizontalAlignment="Center">
                <Button  x:Name="adjustFunction_btn" Content="传感器校准功能" VerticalAlignment="Center" Width="150" Height="150" FontSize="18" Click="adjustFunction_btn_Click"/>
                <Button  x:Name="measurementFunction_btn" Content="屏幕测量" VerticalAlignment="Center" Width="150" Height="150" FontSize="18" Margin="120,0,0,0" Click="measurementFunction_btn_Click"/>
            </StackPanel>
        </Grid>

        <Grid x:Name="adjust_grid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.6*"/>
                    <ColumnDefinition Width="0.4*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Text="量程参数设置" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                <TextBlock Grid.Row="0" Grid.Column="1" Text="Sensor 值测试" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                <Grid Grid.Row="1" Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.3*"/>
                        <ColumnDefinition Width="0.4*"/>
                        <ColumnDefinition Width="0.3*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Center">
                        <Border BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="White" x:Name="white_Border" MouseLeftButtonUp="white_Border_MouseLeftButtonUp" Margin="10"/>
                        <Border BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FFF71717" x:Name="red_Border" MouseLeftButtonUp="red_Border_MouseLeftButtonUp" Margin="10"/>
                        <Border BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FF17F310" x:Name="green_Border" MouseLeftButtonUp="green_Border_MouseLeftButtonUp" Margin="10"/>
                        <Border BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FF1725F7" x:Name="blue_Border" MouseLeftButtonUp="blue_Border_MouseLeftButtonUp" Margin="10"/>
                    </StackPanel>
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="设备号：" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="deviceNum_ComboBox" Height="22" Width="71" HorizontalAlignment="Left" Margin="5,3,0,3">
                        <ComboBoxItem IsSelected="True">0</ComboBoxItem>
                        <ComboBoxItem >1</ComboBoxItem>
                        <ComboBoxItem >2</ComboBoxItem>
                        <ComboBoxItem >3</ComboBoxItem>
                        <ComboBoxItem >4</ComboBoxItem>
                        <ComboBoxItem >5</ComboBoxItem>
                        <ComboBoxItem >6</ComboBoxItem>
                        <ComboBoxItem >7</ComboBoxItem>
                        <ComboBoxItem >8</ComboBoxItem>
                        <ComboBoxItem >9</ComboBoxItem>
                        <ComboBoxItem >10</ComboBoxItem>
                        <ComboBoxItem >11</ComboBoxItem>
                        <ComboBoxItem >12</ComboBoxItem>
                        <ComboBoxItem >13</ComboBoxItem>
                        <ComboBoxItem >14</ComboBoxItem>
                        <ComboBoxItem >15</ComboBoxItem>
                        <ComboBoxItem >16</ComboBoxItem>
                        <ComboBoxItem >17</ComboBoxItem>
                        <ComboBoxItem >18</ComboBoxItem>
                        <ComboBoxItem >19</ComboBoxItem>
                        <ComboBoxItem >20</ComboBoxItem>
                        <ComboBoxItem >21</ComboBoxItem>
                        <ComboBoxItem >22</ComboBoxItem>
                        <ComboBoxItem >23</ComboBoxItem>
                        <ComboBoxItem >24</ComboBoxItem>
                        <ComboBoxItem >25</ComboBoxItem>
                        <ComboBoxItem >26</ComboBoxItem>
                        <ComboBoxItem >27</ComboBoxItem>
                        <ComboBoxItem >28</ComboBoxItem>
                        <ComboBoxItem >29</ComboBoxItem>
                        <ComboBoxItem >30</ComboBoxItem>
                        <ComboBoxItem >31</ComboBoxItem>
                        <ComboBoxItem >32</ComboBoxItem>
                        <ComboBoxItem >33</ComboBoxItem>
                        <ComboBoxItem >34</ComboBoxItem>
                        <ComboBoxItem >35</ComboBoxItem>
                        <ComboBoxItem >36</ComboBoxItem>
                        <ComboBoxItem >37</ComboBoxItem>
                        <ComboBoxItem >38</ComboBoxItem>
                        <ComboBoxItem >39</ComboBoxItem>
                        <ComboBoxItem >40</ComboBoxItem>
                        <ComboBoxItem >41</ComboBoxItem>
                        <ComboBoxItem >42</ComboBoxItem>
                        <ComboBoxItem >43</ComboBoxItem>
                        <ComboBoxItem >44</ComboBoxItem>
                        <ComboBoxItem >45</ComboBoxItem>
                        <ComboBoxItem >46</ComboBoxItem>
                        <ComboBoxItem >47</ComboBoxItem>
                        <ComboBoxItem >48</ComboBoxItem>
                        <ComboBoxItem >49</ComboBoxItem>
                        <ComboBoxItem >50</ComboBoxItem>
                        <ComboBoxItem >51</ComboBoxItem>
                        <ComboBoxItem >52</ComboBoxItem>
                        <ComboBoxItem >53</ComboBoxItem>
                        <ComboBoxItem >54</ComboBoxItem>
                        <ComboBoxItem >55</ComboBoxItem>
                        <ComboBoxItem >56</ComboBoxItem>
                        <ComboBoxItem >57</ComboBoxItem>
                        <ComboBoxItem >58</ComboBoxItem>
                        <ComboBoxItem >59</ComboBoxItem>
                        <ComboBoxItem >60</ComboBoxItem>
                        <ComboBoxItem >61</ComboBoxItem>
                        <ComboBoxItem >62</ComboBoxItem>
                        <ComboBoxItem >63</ComboBoxItem>
                        <ComboBoxItem >64</ComboBoxItem>
                        <ComboBoxItem >65</ComboBoxItem>
                        <ComboBoxItem >255</ComboBoxItem>
                    </ComboBox>
                    <TextBlock Grid.Row="2" Grid.Column="0" Text="参考电流：" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Grid.Row="2" Grid.Column="1" x:Name="referCurrent_ComboBox" Height="22" Width="71" HorizontalAlignment="Left" Margin="5,3,0,3">
                        <ComboBoxItem IsSelected="True" Tag="0">20</ComboBoxItem>
                        <ComboBoxItem Tag="1">80</ComboBoxItem>
                        <ComboBoxItem Tag="2">320</ComboBoxItem>
                        <ComboBoxItem Tag="3">1.28</ComboBoxItem>
                        <ComboBoxItem Tag="4">5.12</ComboBoxItem>
                    </ComboBox>
                    <TextBlock Grid.Row="3" Grid.Column="0" Text="积分时间：" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Grid.Row="3" Grid.Column="1" x:Name="integrationPeriod_ComboBox" Height="22" Width="71" HorizontalAlignment="Left" Margin="5,3,0,3">
                        <ComboBoxItem IsSelected="True" Tag="0">1</ComboBoxItem>
                        <ComboBoxItem Tag="1">2</ComboBoxItem>
                        <ComboBoxItem Tag="2">4</ComboBoxItem>
                        <ComboBoxItem Tag="3">8</ComboBoxItem>
                        <ComboBoxItem Tag="4">16</ComboBoxItem>
                        <ComboBoxItem Tag="5">32</ComboBoxItem>
                        <ComboBoxItem Tag="6">64</ComboBoxItem>
                        <ComboBoxItem Tag="7">128</ComboBoxItem>
                        <ComboBoxItem Tag="8">256</ComboBoxItem>
                        <ComboBoxItem Tag="9">512</ComboBoxItem>
                        <ComboBoxItem Tag="10">1024</ComboBoxItem>
                    </ComboBox>
                    <Button Grid.Row="3" Grid.Column="2" x:Name="setADC_btn" Content="设置" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="setADC_btn_Click"/>
                    <TextBlock Grid.Row="4" Grid.Column="0" Text="传感器读值：" Style="{StaticResource TextBlockStyle}"/>
                    <TextBlock Grid.Row="4" Grid.Column="1" x:Name="collectionValue_TextBlock" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                    <Button Grid.Row="4" Grid.Column="2" x:Name="getSensor_btn" Content="读取" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="getSensor_btn_Click"/>

                </Grid>
                <Grid Grid.Row="1" Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <!--<Button x:Name="update_btn" Content="单板软件升级" VerticalAlignment="Center" Width="151" Height="41" FontSize="12.333"/>-->
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="间隔电流：" Style="{StaticResource TextBlockStyle}"/>
                    <TextBox Grid.Row="0" Grid.Column="1" x:Name="spacingCurrent_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                    <Button Grid.Row="1" Grid.Column="1" x:Name="linearityTest_btn" Content="线性度测试" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="linearityTest_btn_Click"/>

                    <TextBlock Grid.Row="2" Grid.Column="0" Text="采集次数：" Style="{StaticResource TextBlockStyle}"/>
                    <TextBox Grid.Row="2" Grid.Column="1" x:Name="collectionTimes_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                    <Button Grid.Row="3" Grid.Column="1" x:Name="repeatabilityTest_btn" Content="重复性测试" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="repeatabilityTest_btn_Click"/>
                </Grid>

                <Border Grid.Row="0" Grid.Column="0"/>
                <Border Grid.Row="0" Grid.Column="1"/>
                <Border Grid.Row="1" Grid.Column="0"/>
                <Border Grid.Row="1" Grid.Column="1"/>
            </Grid>
            <Grid Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Text="校准参数设置" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                <Border Grid.Row="2" Grid.Column="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="26" Width="41" Margin="10"/>
                <Border Grid.Row="3" Grid.Column="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="26" Width="41" Background="#FFF71717" Margin="10"/>
                <Border Grid.Row="4" Grid.Column="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="26" Width="41" Background="#FF17F310" Margin="10"/>
                <Border Grid.Row="5" Grid.Column="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="26" Width="41" Background="#FF1725F7" Margin="10"/>
                <Border Grid.Row="6" Grid.Column="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="26" Width="41" Background="Black" Margin="10"/>

                <TextBlock Grid.Row="1" Grid.Column="1" Text="校准仪器亮度值" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                <TextBlock Grid.Row="1" Grid.Column="2" Text="传感器亮度值" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>
                <TextBlock Grid.Row="1" Grid.Column="3" Text="传感器暗场值" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left"/>

                <TextBox Grid.Row="2" Grid.Column="1" x:Name="white_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                <TextBox Grid.Row="3" Grid.Column="1" x:Name="red_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                <TextBox Grid.Row="4" Grid.Column="1" x:Name="green_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                <TextBox Grid.Row="5" Grid.Column="1" x:Name="blue_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                <TextBox Grid.Row="6" Grid.Column="1" x:Name="black_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>

                <TextBlock Grid.Row="2" Grid.Column="2" x:Name="whiteLight_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="3" Grid.Column="2" x:Name="redLight_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="4" Grid.Column="2" x:Name="greenLight_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="5" Grid.Column="2" x:Name="blueLight_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>

                <TextBlock Grid.Row="2" Grid.Column="3" x:Name="whiteDark_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="3" Grid.Column="3" x:Name="redDark_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="4" Grid.Column="3" x:Name="greenDark_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>
                <TextBlock Grid.Row="5" Grid.Column="3" x:Name="blueDark_TextBlock" Style="{StaticResource TextBlockStyle}" Width="100"/>

                <Button Grid.Row="5" Grid.Column="4" x:Name="adjust_btn" Content="开始校准" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="adjust_btn_Click"/>
            </Grid>
        </Grid>

        <Grid x:Name="measurement_grid" Visibility="Collapsed">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="0.4*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Text="数据观察区" Margin="20,10,0,10" FontSize="18" HorizontalAlignment="Left"/>
            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <Grid>
                    <!-- 图形-->
                </Grid>
                <ScrollViewer Grid.Column="1">
                    <Grid ScrollViewer.VerticalScrollBarVisibility="Visible">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" Text="角度" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="0" Grid.Column="1" Text="水平" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="0" Grid.Column="2" Text="垂直" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="1" Grid.Column="0" Text="-80" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="1" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="1" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="2" Grid.Column="0" Text="-75" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="2" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="2" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="3" Grid.Column="0" Text="-70" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="3" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="3" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="4" Grid.Column="0" Text="-65" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="4" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="4" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="5" Grid.Column="0" Text="-60" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="5" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="5" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="6" Grid.Column="0" Text="-55" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="6" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="6" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="7" Grid.Column="0" Text="-50" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="7" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="7" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="8" Grid.Column="0" Text="-45" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="8" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="8" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="9" Grid.Column="0" Text="-40" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="9" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="9" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="10" Grid.Column="0" Text="-35" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="10" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="10" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="11" Grid.Column="0" Text="-30" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="11" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="11" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="12" Grid.Column="0" Text="-25" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="12" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="12" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="13" Grid.Column="0" Text="-20" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="13" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="13" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="14" Grid.Column="0" Text="-15" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="14" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="14" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="15" Grid.Column="0" Text="-10" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="15" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="15" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="16" Grid.Column="0" Text="-5" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="16" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="16" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="17" Grid.Column="0" Text="0" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="17" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="17" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="18" Grid.Column="0" Text="5" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="18" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="18" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="19" Grid.Column="0" Text="10" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="19" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="19" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="20" Grid.Column="0" Text="15" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="20" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="20" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="21" Grid.Column="0" Text="20" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="21" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="21" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="22" Grid.Column="0" Text="25" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="22" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="22" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="23" Grid.Column="0" Text="30" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="23" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="23" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="24" Grid.Column="0" Text="35" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="24" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="24" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="25" Grid.Column="0" Text="40" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="25" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="25" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="26" Grid.Column="0" Text="45" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="26" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="26" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="27" Grid.Column="0" Text="50" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="27" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="27" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="28" Grid.Column="0" Text="55" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="28" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="28" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="29" Grid.Column="0" Text="60" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="29" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="29" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="30" Grid.Column="0" Text="65" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="30" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="30" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="31" Grid.Column="0" Text="70" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="31" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="31" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="32" Grid.Column="0" Text="75" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="32" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="32" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>

                        <TextBlock Grid.Row="33" Grid.Column="0" Text="80" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="33" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
                        <TextBlock Grid.Row="33" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>
                    </Grid>
                </ScrollViewer>
                <Grid Grid.Column="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Border Grid.Row="0" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="White" x:Name="whiteMeasurement_Border" Margin="10"/>
                    <Border Grid.Row="1" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FFF71717" x:Name="redMeasurement_Border" Margin="10"/>
                    <Border Grid.Row="2" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FF17F310" x:Name="greenMeasurement_Border" Margin="10"/>
                    <Border Grid.Row="3" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Height="26" Width="41" Background="#FF1725F7" x:Name="blueMeasurement_Border" Margin="10"/>

                    <TextBox Grid.Row="0" Grid.Column="1" x:Name="whiteMeasurement_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                    <TextBox Grid.Row="1" Grid.Column="1" x:Name="redMeasurement_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                    <TextBox Grid.Row="2" Grid.Column="1" x:Name="greenMeasurement_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                    <TextBox Grid.Row="3" Grid.Column="1" x:Name="blueMeasurement_TextBox" Style="{StaticResource TextBoxStyle}" Width="100"/>
                </Grid>
            </Grid>
            <TextBlock Grid.Row="2" Text="主操作区" Margin="20,10,0,10" FontSize="18" HorizontalAlignment="Left"/>
            <StackPanel Grid.Row="3">
                <Button  x:Name="measurement_btn" Content="测试" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="measurement_btn_Click"/>
            </StackPanel>
            <TextBlock Grid.Row="4" Text="测试结果" Margin="20,10,0,10" FontSize="18" HorizontalAlignment="Left"/>
            <Grid Grid.Row="5">

            </Grid>
        </Grid>
    </Grid>
</Window>
